package de.herberlin.contact;

/**
 * The listener interface for receiving progress events.
 * The class that is interested in processing a progress
 * event implements this interface, and the object created
 * with that class is registered with a component using the
 * component's <code>addProgressListener<code> method. When
 * the progress event occurs, that object's appropriate
 * method is invoked.
 * 
 * @see ProgressEvent
 */
public interface ProgressListener {

	/**
	 * Progress.
	 * 
	 * @param ev the ev
	 */
	void progress(ProgressEvent ev);
	
	/**
	 * The Class ProgressEvent.
	 */
	public static class ProgressEvent {
		
		/**
		 * Gets the total number of steps of the process.
		 * 
		 * @return the total
		 */
		public int getTotal() {
			return total;
		}
		
		/**
		 * Gets the current step number.
		 * 
		 * @return the current
		 */
		public int getCurrent() {
			return current;
		}
		
		/**
		 * Instantiates a new progress event.
		 * 
		 * @param total the total
		 * @param current the current
		 */
		public ProgressEvent(int total, int current) {
			this.total=total;
			this.current=current;
		}
		
		/** The total. */
		private int total=0;
		
		/** The current. */
		private int current=0;
	}
}
